public class Test {
    public static void main(String[] args) {
        myStack3 stack3=new myStack3();
        stack3.push(1);
        stack3.push(2);
        stack3.push(3);
        stack3.push(4);
        System.out.println(stack3.pop());
        System.out.println(stack3.pop());
        System.out.println(stack3.pop());
        System.out.println(stack3.pop());
        System.out.println(stack3.pop());
        System.out.println(stack3.peek());
        System.out.println(stack3.empty());
    }
    public static void main2(String[] args) {
        myStack2 stack2=new myStack2();
        for (int i = 1; i < 5; i++) stack2.push(i);
        System.out.println(stack2.pop());
        System.out.println(stack2.pop());
        System.out.println(stack2.pop());
        System.out.println(stack2.pop());
        System.out.println(stack2.pop());
        System.out.println(stack2.peek());
        System.out.println(stack2.empty());
    }
    public static void main1(String[] args) {
        myStack stack=new myStack();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.peek());
    }

}

